<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Login AVILA</title>
	<h:outputStylesheet name="loginStyle.css" library="css" />
</h:head>
<h:body>
	<div id="wrapDiv">
		<div id="logoDiv">
			<!-- 			<h:graphicImage name="avila.jpg" library="img" /> -->
		</div>
		<div id="loginDiv">
			<h:form id="loginForm">
				<p:growl id="growl" showDetail="true" life="3000" />
				<p:panel id="loginPanel" header="Login" widgetVar="dlg">
					<h:panelGrid columns="2" cellpadding="5">
						<h:outputLabel for="usuario" value="Usuario: " />
						<p:inputText value="#{usuarioBean.usuario}" id="usuario" required="true" label="usuario" />

						<h:outputLabel for="clave" value="Password:" />
						<p:password value="#{usuarioBean.password}" id="clave" required="true" label="clave" />

						<f:facet name="footer">
							<p:commandButton id="loginButton" value="Login" update="growl" actionListener="#{usuarioBacking.login}" icon="icon-login"
								oncomplete="handleLoginRequest(xhr, status, args)" />
						</f:facet>
					</h:panelGrid>
				</p:panel>
			</h:form>
		</div>
		<script type="text/javascript">  
		    function handleLoginRequest(xhr, status, args) {  
		        if(args.validationFailed || !args.loggedIn) {  
		            PF('dlg').jq.effect("shake", { times:5 }, 100);  
		        }   
		        else {  
// 		            PF('dlg').hide();  
// 		            $('#loginLink').fadeOut();  
					location.href = "/hiperion_web/pages/general/accesoSistema.jsf";
		        }  
		    }  
		</script>
	</div>
</h:body>
</html>
